import { View } from "../../../../mvc/core/View";
import { ImagesConst } from "../../../resource/ImagesConst";
import { Cache } from "../../../cache/Cache";
import { GameDefConfig } from "../../../resource/GameDefConfig";
import { Language } from "../../../../../extend/language/Language";
import { ProgressBarWithLvItem } from "./ProgressBarWithLvItem";
import { WardrobeConfig } from "../../../resource/WardrobeConfig";
type int = number;
//class FashionBoxFlyWingAttTotalSp
    
    export  class FashionBoxFlyWingAttTotalSp extends View
    {
        constructor()
        {
            super();
            this._barArr = [];
            this.initView();
            return;
        }

        /* internal  */initView(): void
        {
            var loc2=null;
            var loc3=0;
            var loc6=null;
            var loc1=[ImagesConst.YellowBar10, ImagesConst.GreenBar10, ImagesConst.RedBar10, ImagesConst.PurpleBar10, ImagesConst.BlueBar10];
            var loc4="";
            var loc5=0;
            while (loc5 < this._ITEMNUM) 
            {
                loc3 = Cache.instance.wardrobe.FlyWingAttArr[loc5];
                if (loc6 = GameDefConfig.instance.getEJewel(loc3)) 
                {
                    if (loc3 == 12 || loc3 == 13) 
                    {
                        loc4 = Language.getString(36306);
                    }
                    else if (loc3 == 8 || loc3 == 9) 
                    {
                        loc4 = Language.getString(36305);
                    }
                    else 
                    {
                        loc4 = loc6.text1;
                    }
                }
                loc2 = new ProgressBarWithLvItem(Language.getStringByParam(74666, loc4) + "：", loc1[loc5], 138, 12);
                loc2.y = loc5 * 22;
                addChild(loc2);
                this._barArr.push(loc2);
                ++loc5;
            }
            return;
        }

        public updateInfo(arg1: Map<any, any> /* flash.utils.Dictionary */, arg2: Map<any, any> /* flash.utils.Dictionary */): void
        {
            var loc1=null;
            var loc2=0;
            while (loc2 < this._ITEMNUM) 
            {
                loc1 = this._barArr[loc2];
                loc1.setLvTx(arg1[Cache.instance.wardrobe.FlyWingAttArr[loc2]]);
                loc1.setBarValue(arg2[Cache.instance.wardrobe.FlyWingAttArr[loc2]], WardrobeConfig.instance.getFlyLvGrowNeddExp(arg1[Cache.instance.wardrobe.FlyWingAttArr[loc2]]));
                ++loc2;
            }
            return;
        }

        public shineBar(arg1: Map<any, any> /* flash.utils.Dictionary */): void
        {
            var loc1=null;
            var loc2=0;
            var loc3=0;
            while (loc3 < this._ITEMNUM) 
            {
                loc2 = Cache.instance.wardrobe.FlyWingAttArr[loc3];
                loc1 = this._barArr[loc3];
                if (arg1[loc2] && arg1[loc2] > 0) 
                {
                    loc1.shine();
                }
                ++loc3;
            }
            return;
        }

        /* internal */ /* const */_ITEMNUM: int=5;

        /* internal */ /* var */_barArr: Array<any>;
    }
